﻿<?php
class ADMINClass
{//管理员登陆操作类
	var $adminname;
	var $password;
	
	var $url;
	var $type;
	var $Sstring;
	
	var $Su_url;
	var $su_type;
	
	var $smPicPath;// 用于MessgBox()
	var $smMsg;// 用于MessgBox()
	var $smURL;// 用于MessgBox()
	var $guanliDir;
	var $chaojizhanghao;
	var $UserName;  //登陆的管理员用户名
	
	function login()
	{
		
		$Mydb=new YYBDB();
		
		global $SystemConest;
		$sqlrs="select * from ".$SystemConest[7]."sysadmin where sysadmin1='".$this->adminname."' and sysadmin2='".$this->password."'";
 		$rsc=$Mydb->db_select_query($sqlrs);
		if($rsc)
		{
			$rs=$Mydb->db_fetch_array($rsc);
			if($Mydb->db_num_rows($rsc)>0)
			{
				$_SESSION["Login"]=$rs;
			}
		}
		
	}
	
function loginCheck($MenuId)//验证管理员是否登陆
{
	global $SystemConest;
	if(!isset($_SESSION["Login"]))
	{
		
		$this->smMsg="您没有登陆或无权限";
		$this->smURL= "/".$SystemConest[1]."/main.php";
		$this->smPicPath="/".$SystemConest[1]."/Iamges/Error.jpg";
		$this->MessgBox($smPicPath,$smMsg,$smURL);
		die;
	}	
	
	//更新权限
	if(GetUpdateRule(GetUserMenuRuleValue($MenuId,$mydb,$_SESSION["Login"][0]))==false  && $_SESSION["Login"][1]<>$SystemConest[2])
	{ 
		
		$this->smPicPath="/".$SystemConest[1]."/Iamges/Error.jpg";
		$this->smMsg="您没有操作权限！";
		$this->smURL="/".$SystemConest[1]."/main.php";
		$this->MessgBox();
		die;
	}

}	

function MessgBox() 
{ 
//需要三个值 $smPicPath,$smMsg,$smURL
global $SystemConest;
?>
  <table width="95%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="555" height="180"><div align="right"><img src="<?php echo $this->smPicPath;?>" width="227" height="119" /></div></td>
    <td width="13"></td>
    <td width="358" valign="bottom"><p class="TDLine"><?php echo $this->smMsg;?> </p>
    <p>&nbsp;</p></td>
  </tr>
  <tr>
    <td colspan="3"><div align="center"><a href="<?php echo $this->smURL;?>"><img src="/<?php echo $SystemConest[1];?>/Iamges/Back.jpg" width="171" height="52" border="0" /></a></div></td>
  </tr>
</table>
	<?php  
	}
}//类结束


?>